﻿using UnityEngine;
using System.Collections;

public class SSCIapAdapter  {
	private static string _methodSetGameObjName = "setGameObjName";
	private static string _methodQueryNative = "onQuery_Native";
	private static string _methodPurchaseNative = "onPurchase_Native";

	private static SSCIapAdapter _instance;

	public static SSCIapAdapter getInstance(){
		if (_instance == null) {
			_instance = new SSCIapAdapter ();
		}
		return _instance;
	}

	public void setGameObjectName(string name){
		AndroidHelper.getIapManagerAndroidObject ().Call (_methodSetGameObjName, name);
	}
		
	public void restore(){
		AndroidHelper.getIapManagerAndroidObject ().Call (_methodQueryNative, false);
	}

	public void query(){
		AndroidHelper.getIapManagerAndroidObject ().Call (_methodQueryNative, true);
	}
	public void purchase(string sku,string skuType){
		AndroidHelper.getIapManagerAndroidObject ().Call (_methodPurchaseNative, sku, skuType);
	}
}
